home *** CD-ROM | disk | FTP | other *** search
/ Trusted Irix /B 4.0.4 / Trusted-Irix B-4.0.1.iso / dist / eoe1.idb / usr / include / sys / swap.h.z / swap.h
C/C++ Source or Header  |  1992-04-03  |  3KB  |  83 lines

  1. /*    Copyright (c) 1984 AT&T    */
  2. /*      All Rights Reserved      */
  3.  
  4. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T    */
  5. /*    The copyright notice above does not evidence any       */
  6. /*    actual or intended publication of such source code.    */
  7.  
  8. /*#ident    "@(#)kern-port:sys/swap.h    10.2"*/
  9. #ident    "$Revision: 3.8 $"
  10. /*    The following structure contains the data describing a
  11.  *    swap file.
  12.  */
  13.  
  14. typedef struct swaptab {
  15.     dev_t    st_dev;        /* The swap device.        */
  16.     short    st_flags;    /* Flags defined below.        */
  17.     use_t    *st_ucnt;    /* Ptr to use count array for    */
  18.                 /* pages on swap.        */
  19.     long    *st_cksum;    /* Ptr to debug checksum array.    */
  20.     use_t    *st_next;    /* Ptr to next page at which    */
  21.                 /* to start searching.        */
  22.     int    st_swplo;    /* First block number on device    */
  23.                 /* to be used for swapping.    */
  24.     int    st_npgs;    /* Number of pages of swap    */
  25.                 /* space on device.        */
  26.     int    st_nfpgs;    /* Nbr of free pages on device.    */
  27.     int    st_pad[1];    /* Round size to 2^n.        */
  28. } swpt_t;
  29.  
  30. #define    ST_INDEL    0x01    /* This file is in the process     */
  31.                 /* of being deleted.  Don't    */
  32.                 /* allocate from it.        */
  33. #define    ST_INADD    0x02    /* This file is in the process     */
  34.                 /* of being allocated.  Don't    */
  35.                 /* allocate from it.        */
  36.  
  37.  
  38. extern swpt_t    swaptab[];    /* The table of swap files.    */
  39. extern int    nextswap;    /* Index into swptab to the    */
  40.                 /* next file to  allocate from.    */
  41.  
  42. #define    MSFILES    16        /* The maximum number of swap    */
  43.                 /* files which can be allocated.*/
  44.                 /* It is limited by the size of    */
  45.                 /* the dbd_swpi field in the    */
  46.                 /* dbd_t structure.        */
  47.  
  48.  
  49. /*    The following struct is used by the sysmips system call.
  50.  *    If the first argument to the sysmips system call is SMIPSSWPI,
  51.  *    then the call pertains to the swap file.  In this case,
  52.  *    the second argument is a pointer to a structure of the
  53.  *    following format which contains the parameters for the
  54.  *    operation to be performed.
  55.  */
  56.  
  57. typedef struct swapint {
  58.     char    si_cmd;        /* One of the command codes    */
  59.                 /* listed below.        */
  60.     char    *si_buf;    /* For an SI_LIST function, this*/
  61.                 /* is a pointer to a buffer of    */
  62.                 /* sizeof(swpt_t)*MSFILES bytes.*/
  63.                 /* For the other cases, it is a    */
  64.                 /* pointer to a pathname of a    */
  65.                 /* swap file.            */
  66.     int    si_swplo;    /* The first block number of the*/
  67.                 /* swap file.  Used only for    */
  68.                 /* SI_ADD and SI_DEL.        */
  69.     int    si_nblks;    /* The size of the swap file in    */
  70.                 /* blocks.  Used only for an    */
  71.                 /* SI_ADD request.        */
  72. } swpi_t;
  73.  
  74. /*    The following are the possible values for si_cmd.
  75.  */
  76.  
  77. #define    SI_LIST        0    /* List the currently active    */
  78.                 /* swap files.            */
  79. #define    SI_ADD        1    /* Add a new swap file.        */
  80. #define    SI_DEL        2    /* Delete one of the currently    */
  81.                 /* active swap files.        */
  82.  
  83.